package com.winit.requirement.service.impl;

import com.github.pagehelper.PageHelper;
import com.winit.requirement.mapper.ReqMapper;
import com.winit.requirement.model.Req;
import com.winit.requirement.service.ReqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "reqService")
public class ReqServiceImpl implements ReqService{

    @Autowired
    private ReqMapper reqMapper;

    @Override
    public Req selectByPrimaryKey(String reqId) {
        return reqMapper.selectByPrimaryKey(reqId);
    }

    @Override
    public int updateByPrimaryKey(Req record) {
        reqMapper.updateByPrimaryKey(record);
        return 0;
    }

    @Override
    public List<Req> findAllReq(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return reqMapper.findAllReq();
    }
}
